<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of v_rfft</title>
  <meta name="keywords" content="v_rfft">
  <meta name="description" content="V_RFFT     Calculate the DFT of real data Y=(X,N,D)">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt;  <a href="index.html">v_mfiles</a> &gt; v_rfft.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for v_mfiles&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->

<h1>v_rfft
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>V_RFFT     Calculate the DFT of real data Y=(X,N,D)</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function y=v_rfft(x,n,d) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment">V_RFFT     Calculate the DFT of real data Y=(X,N,D)
 Data is truncated/padded to length N if specified.
   N even:    (N+2)/2 points are returned with
             the first and last being real
   N odd:    (N+1)/2 points are returned with the
             first being real
 In all cases fix(1+N/2) points are returned
 D is the dimension along which to do the DFT</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="v_fxrapt.html" class="code" title="function [fx,tt]=v_fxrapt(s,fs,mode,q)">v_fxrapt</a>	V_FXRAPT RAPT pitch tracker [FX,VUV]=(S,FS,M,Q)</li><li><a href="v_lpcar2db.html" class="code" title="function [db,f]=v_lpcar2db(ar,np)">v_lpcar2db</a>	V_LPCAR2DB LPC: Convert AR coefs to power spectrum in dB DB=(AR)</li><li><a href="v_lpcar2ff.html" class="code" title="function [ff,f]=v_lpcar2ff(ar,np)">v_lpcar2ff</a>	V_LPCAR2FF LPC: Convert AR coefs to complex spectrum FF=(AR,NP)</li><li><a href="v_lpcar2pf.html" class="code" title="function [pf,f]=v_lpcar2pf(ar,np)">v_lpcar2pf</a>	V_LPCAR2PF Convert AR coefs to power spectrum PF=(AR,NP)</li><li><a href="v_lpccc2db.html" class="code" title="function [db,f]=v_lpccc2db(cc,np,nc,c0)">v_lpccc2db</a>	V_LPCCC2DB Convert complex cepstrum to dB power spectrum DB=(CC,NP,NC)</li><li><a href="v_lpccc2ff.html" class="code" title="function [ff,f]=v_lpccc2ff(cc,np,nc,c0)">v_lpccc2ff</a>	V_LPCCC2FF Convert complex cepstrum to complex spectrum FF=(CC,NP,NC)</li><li><a href="v_lpccc2pf.html" class="code" title="function [pf,f]=v_lpccc2pf(cc,np,nc,c0)">v_lpccc2pf</a>	V_LPCCC2PF Convert complex cepstrum to power spectrum PF=(CC,NP,NC)</li><li><a href="v_lpcra2pf.html" class="code" title="function pf=v_lpcra2pf(ra,np)">v_lpcra2pf</a>	V_LPCAR2PF Convert AR coefs to power spectrum PF=(RA,NP)</li><li><a href="v_modspect.html" class="code" title="function [c,qq,ff,tt,po]=v_modspect(s,fs,m,nf,nq,p)">v_modspect</a>	V_MODSPECT Calculate the modulation spectrum of a signal C=(S,FS,W,NC,P,N,INC,FL,FH)</li><li><a href="v_sigalign.html" class="code" title="function [d,g,rr,ss]=v_sigalign(s,r,maxd,m,fs)">v_sigalign</a>	V_SIGALIGN align a clean reference with a noisy signal [d,g,rr,ss]=(s,r,maxd,m,fs)</li><li><a href="v_specsub.html" class="code" title="function [ss,gg,tt,ff,zo]=v_specsub(si,fsz,pp)">v_specsub</a>	V_SPECSUB performs speech enhancement using spectral subtraction [SS,ZO]=(S,FSZ,P)</li><li><a href="v_specsubm.html" class="code" title="function [ss,po]=v_specsubm(s,fs,p)">v_specsubm</a>	V_SPECSUBM obsolete speech enhancement algorithm - use v_specsub instead</li><li><a href="v_spendred.html" class="code" title="function [enhanced_speech] = v_spendred(input_speech,fs,algo_params)">v_spendred</a>	V_SPENDRED Speech Enhancement and Dereverberation by Doire</li><li><a href="v_spgrambw.html" class="code" title="function [t,f,b]=v_spgrambw(s,fs,varargin)">v_spgrambw</a>	V_SPGRAMBW Draw spectrogram [T,F,B]=(s,fs,mode,bw,fmax,db,tinc,ann)</li><li><a href="v_ssubmmse.html" class="code" title="function [ss,gg,tt,ff,zo]=v_ssubmmse(si,fsz,pp)">v_ssubmmse</a>	V_SSUBMMSE performs speech enhancement using mmse estimate of spectral amplitude or log amplitude [SS,ZO]=(S,FSZ,PP)</li><li><a href="v_ssubmmsev.html" class="code" title="function [ss,gg,tt,ff,zo]=v_ssubmmsev(si,fsz,pp)">v_ssubmmsev</a>	V_SSUBMMSE performs speech enhancement using mmse estimate of spectral amplitude or log amplitude [SS,ZO]=(S,FSZ,P)</li><li><a href="v_vadsohn.html" class="code" title="function [vs,zo]=v_vadsohn(si,fsz,m,pp)">v_vadsohn</a>	V_VADSOHN implements a voice activity detector [VS,ZO]=(S,FSZ,M,P)</li></ul>
<!-- crossreference -->


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function y=v_rfft(x,n,d)</a>
0002 <span class="comment">%V_RFFT     Calculate the DFT of real data Y=(X,N,D)</span>
0003 <span class="comment">% Data is truncated/padded to length N if specified.</span>
0004 <span class="comment">%   N even:    (N+2)/2 points are returned with</span>
0005 <span class="comment">%             the first and last being real</span>
0006 <span class="comment">%   N odd:    (N+1)/2 points are returned with the</span>
0007 <span class="comment">%             first being real</span>
0008 <span class="comment">% In all cases fix(1+N/2) points are returned</span>
0009 <span class="comment">% D is the dimension along which to do the DFT</span>
0010 
0011 
0012 
0013 <span class="comment">%      Copyright (C) Mike Brookes 1998</span>
0014 <span class="comment">%      Version: $Id: v_rfft.m 10865 2018-09-21 17:22:45Z dmb $</span>
0015 <span class="comment">%</span>
0016 <span class="comment">%   VOICEBOX is a MATLAB toolbox for speech processing.</span>
0017 <span class="comment">%   Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html</span>
0018 <span class="comment">%</span>
0019 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
0020 <span class="comment">%   This program is free software; you can redistribute it and/or modify</span>
0021 <span class="comment">%   it under the terms of the GNU General Public License as published by</span>
0022 <span class="comment">%   the Free Software Foundation; either version 2 of the License, or</span>
0023 <span class="comment">%   (at your option) any later version.</span>
0024 <span class="comment">%</span>
0025 <span class="comment">%   This program is distributed in the hope that it will be useful,</span>
0026 <span class="comment">%   but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
0027 <span class="comment">%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
0028 <span class="comment">%   GNU General Public License for more details.</span>
0029 <span class="comment">%</span>
0030 <span class="comment">%   You can obtain a copy of the GNU General Public License from</span>
0031 <span class="comment">%   http://www.gnu.org/copyleft/gpl.html or by writing to</span>
0032 <span class="comment">%   Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.</span>
0033 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
0034 
0035 s=size(x);
0036 <span class="keyword">if</span> prod(s)==1
0037     y=x
0038 <span class="keyword">else</span>
0039     <span class="keyword">if</span> nargin &lt;3 || isempty(d)
0040         d=find(s&gt;1,1);
0041         <span class="keyword">if</span> nargin&lt;2
0042             n=s(d);
0043         <span class="keyword">end</span>
0044     <span class="keyword">end</span>
0045     <span class="keyword">if</span> isempty(n) 
0046         n=s(d);
0047     <span class="keyword">end</span>
0048     y=fft(x,n,d);
0049     y=reshape(y,prod(s(1:d-1)),n,prod(s(d+1:end))); 
0050     s(d)=1+fix(n/2);
0051     y(:,s(d)+1:<span class="keyword">end</span>,:)=[];
0052     y=reshape(y,s);
0053 <span class="keyword">end</span></pre></div>
<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>